<?php
/**
 * @ClassName: EquipmentCustomer
 * @Description: 水架客户关联
 * @author: gydtrade
 * @Date: 2025-05-28 17:20
 * @Version: V1.0.0
 */

namespace app\common\model;

use think\Model;
use think\model\concern\SoftDelete;

class EquipmentCustomer extends Model
{
    use SoftDelete;

    protected $name = 'equipment_customer';

    protected $autoWriteTimestamp = 'dateTime';

    /**
     * 说明: 定义反向关联, 关联至设备表
     * @return \think\model\relation\BelongsTo
     */
    public function quipment()
    {
        return $this->belongsTo(Equipment::class, 'device_id', 'id');
    }

    /**
     * 说明: 定义反向关联, 关联至客户表
     * @return \think\model\relation\BelongsTo
     */
    public function customer()
    {
        return $this->belongsTo(Customer::class, 'customer_id', 'id');
    }

}